package com.stxx.assistant.controller;

import com.stxx.assistant.domain.SysConfig;
import com.stxx.assistant.framwork.domain.R;
import com.stxx.assistant.framwork.domain.model.PageQuery;
import com.stxx.assistant.service.SysConfigService;
import org.noear.solon.annotation.*;

import java.sql.SQLException;
import java.util.List;

/**
 * @author Fuzhenlei
 * @date 2025/02/20 17:06
 */
@Controller
@Mapping("/config")
public class SysConfigController {
    @Inject
    SysConfigService configService;
    @Get
    @Mapping("/list")
    public R<List<SysConfig>> configList(SysConfig bo, PageQuery pageQuery) throws SQLException {
        List<SysConfig> r = configService.list(bo);
        return R.ok(r);
    }

    @Post
    @Mapping("")
    public R<Object> configUpdate(@Body SysConfig bo) throws SQLException {
        configService.update(bo);
        return R.ok("数据保存成功");
    }
}
